#!/bin/bash
#生成网络
export FABRIC_CFG_PATH=${PWD}
echo "生成网络"
cryptogen generate --config=./crypto-config.yaml
echo "拷贝文件"
cp crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/ 
cp crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem crypto-config/peerOrganizations/org1.example.com/msp/admincerts/ 
cp crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/admincerts/ 
cp crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem crypto-config/peerOrganizations/org2.example.com/msp/admincerts/
cp crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/signcerts/Admin@org3.example.com-cert.pem crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/admincerts/ 
cp crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp/signcerts/Admin@org3.example.com-cert.pem crypto-config/peerOrganizations/org3.example.com/msp/admincerts/
echo "生成网络初始文件"
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./config/genesis.block